#pragma once
#include <string>

namespace krryn{
namespace view{
    class canvas;

    class image_file{
    public:
        virtual canvas *load() const = 0;
        virtual void store(canvas *a_Canvas) const = 0;
        virtual ~image_file() {}
    };
    
    class image_file_tga : public image_file{
    public:
        image_file_tga(const std::string a_Filename) : m_Filename(a_Filename) {}
        virtual canvas *load() const;
        virtual void store(canvas *a_Canvas) const;
    private:
        canvas *read_image(unsigned char *a_Data, int a_Width, 
			int a_Height, int a_Depth, bool a_IsTopLeft) const;
        const std::string m_Filename;
        int m_Width, m_Height, m_BitDepth;
    };
    
    class image_file_bmp : public image_file{
    public:
        image_file_bmp(const std::string a_Filename) : m_Filename(a_Filename) {}
        virtual canvas *load() const;
        virtual void store(canvas *a_Canvas) const;
    private:
        const std::string m_Filename;
    };
}
}
